From 14ff9bf71252352ab935bbd5c8e1a75398b74a89 Mon Sep 17 00:00:00 2001 From: "kaf24@labyrinth.cl.cam.ac.uk" Date: Sun, 19 Jan 2003 20:34:43 +0000 Subject: [PATCH] bitkeeper revision 1.15.1.7 (3e2b0be3giRAXsN5jAmCONe953mK9w) page.h, page_alloc.c, mm.c: Fixed PGEXT_INVLPG, plus a few other cleanups. --- xen-2.4.16/arch/i386/mm.c | 3 ++- xen-2.4.16/common/page_alloc.c | 32 +++++++++++++++--------------- xen-2.4.16/include/asm-i386/page.h | 4 ++-- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/xen-2.4.16/arch/i386/mm.c b/xen-2.4.16/arch/i386/mm.c index 2260882efc..29553a9c9b 100644 --- a/xen-2.4.16/arch/i386/mm.c +++ b/xen-2.4.16/arch/i386/mm.c @@ -102,7 +102,8 @@ long do_stack_and_ldt_switch( if ( ldts != current->mm.ldt_sel ) { - unsigned long *ptabent = GET_GDT_ADDRESS(current); + unsigned long *ptabent; + ptabent = (unsigned long *)GET_GDT_ADDRESS(current); /* Out of range for GDT table? */ if ( (ldts * 8) > GET_GDT_ENTRIES(current) ) return -1; ptabent += ldts * 2; /* 8 bytes per desc == 2 * unsigned long */ diff --git a/xen-2.4.16/common/page_alloc.c b/xen-2.4.16/common/page_alloc.c index 0631d11a74..1bfeed440f 100644 --- a/xen-2.4.16/common/page_alloc.c +++ b/xen-2.4.16/common/page_alloc.c @@ -12,7 +12,7 @@ #include #include #include - +#include static spinlock_t alloc_lock = SPIN_LOCK_UNLOCKED; @@ -102,7 +102,7 @@ struct chunk_tail_st { /* Linked lists of free chunks of different powers-of-two in size. */ #define FREELIST_SIZE ((sizeof(void*)<<3)-PAGE_SHIFT) -static chunk_head_t *free_list[FREELIST_SIZE]; +static chunk_head_t *free_head[FREELIST_SIZE]; static chunk_head_t free_tail[FREELIST_SIZE]; #define FREELIST_EMPTY(_l) ((_l)->next == NULL) @@ -120,8 +120,8 @@ void __init init_page_allocator(unsigned long min, unsigned long max) for ( i = 0; i < FREELIST_SIZE; i++ ) { - free_list[i] = &free_tail[i]; - free_tail[i].pprev = &free_list[i]; + free_head[i] = &free_tail[i]; + free_tail[i].pprev = &free_head[i]; free_tail[i].next = NULL; } @@ -159,10 +159,10 @@ void __init init_page_allocator(unsigned long min, unsigned long max) ct = (chunk_tail_t *)min-1; i -= PAGE_SHIFT; ch->level = i; - ch->next = free_list[i]; - ch->pprev = &free_list[i]; + ch->next = free_head[i]; + ch->pprev = &free_head[i]; ch->next->pprev = &ch->next; - free_list[i] = ch; + free_head[i] = ch; ct->level = i; } } @@ -182,15 +182,15 @@ retry: /* Find smallest order which can satisfy the request. */ for ( i = order; i < FREELIST_SIZE; i++ ) { - if ( !FREELIST_EMPTY(free_list[i]) ) + if ( !FREELIST_EMPTY(free_head[i]) ) break; } if ( i == FREELIST_SIZE ) goto no_memory; /* Unlink a chunk. */ - alloc_ch = free_list[i]; - free_list[i] = alloc_ch->next; + alloc_ch = free_head[i]; + free_head[i] = alloc_ch->next; alloc_ch->next->pprev = alloc_ch->pprev; /* We may have to break the chunk a number of times. */ @@ -203,13 +203,13 @@ retry: /* Create new header for spare chunk. */ spare_ch->level = i; - spare_ch->next = free_list[i]; - spare_ch->pprev = &free_list[i]; + spare_ch->next = free_head[i]; + spare_ch->pprev = &free_head[i]; spare_ct->level = i; /* Link in the spare chunk. */ spare_ch->next->pprev = &spare_ch->next; - free_list[i] = spare_ch; + free_head[i] = spare_ch; } map_alloc(__pa(alloc_ch)>>PAGE_SHIFT, 1<level = order; ch->level = order; - ch->pprev = &free_list[order]; - ch->next = free_list[order]; + ch->pprev = &free_head[order]; + ch->next = free_head[order]; ch->next->pprev = &ch->next; - free_list[order] = ch; + free_head[order] = ch; spin_unlock_irqrestore(&alloc_lock, flags); } diff --git a/xen-2.4.16/include/asm-i386/page.h b/xen-2.4.16/include/asm-i386/page.h index b6fe406f0c..b0d68a324a 100644 --- a/xen-2.4.16/include/asm-i386/page.h +++ b/xen-2.4.16/include/asm-i386/page.h @@ -123,8 +123,8 @@ extern void paging_init(void); : "memory"); \ } while (0) -#define __flush_tlb_one(addr) \ -__asm__ __volatile__("invlpg %0": :"m" (*(char *) addr)) +#define __flush_tlb_one(__addr) \ +__asm__ __volatile__("invlpg %0": :"m" (*(char *) (__addr))) #endif /* !__ASSEMBLY__ */ -- 2.30.2